<template>

	<div class="home-container">
		<h1 class="home-title">
			{{admin_name}}
		</h1>
		<p class="home-des">
			尊敬的 {{ userInfo && userInfo.username}} 用户，欢迎使用商城管理员系统
		</p>

	</div>
</template>

<script>
	import {
		useUserStore
	} from "@/store";
	import {
		base,
		getVersion
	} from '@/api/user.js';
	const userInfo = useUserStore();
	export default {
		data() {
			return {
				userInfo,
				admin_name: '',
			};
		},
		created() {
			/*获取数据*/
			this.getData();
			this.getTableList();
		},
		methods: {
			/*获取基础配置*/
			getData() {
				let self = this;
				base({}, true)
					.then(res => {
						const data = res.data.settings;
						self.admin_name = data.admin_name;
					})
					.catch(error => {});
			},
			/*获取数据*/
			getTableList() {
				getVersion({}).then(data => {
						this.loading = false;
						this.version = data.data.version;
					})
					.catch(error => {
						this.loading = false;
					});
			},
		}
	}
</script>

<style lang="scss">
	.home-container {
		height: calc(100vh - 120px);
		display: flex;
		justify-content: center;
		align-items: center;
		text-align: center;
		align-content: center;
		flex-direction: column;
		// background: url(/static/imgs/home_bg.jpg) center center no-repeat;
	}

	.home-container .home-title {
		padding: 20px;
		text-align: center;
		white-space: nowrap;
		text-align: center;
		font-size: 40px;
		color: #409EFF;
	}

	.home-container .home-des {
		color: #888888;
	}

	.home-index {
		display: -ms-flexbox;
		display: flex;
		-webkit-box-orient: horizontal;
		-webkit-box-direction: normal;
		-ms-flex-direction: row;
		flex-direction: row;
		-webkit-box-pack: justify;
		-ms-flex-pack: justify;
		justify-content: space-between;
		min-width: 1000px;
		overflow-x: auto;
	}
</style>